package com.tao.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @ClassName ConsumerController
 * @Author HETAO
 * @Date 2020/5/9 20:28
 */
@RestController
@RequestMapping("consumer")
public class ConsumerController {

    public static final String PROVIDER_URL = "http://cloud-zookeeper-provider8004";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("zk")
    public String getReslt() {
        String result = restTemplate.getForObject(PROVIDER_URL+"/payment/zk", String.class);
        return  result;
    }
}
